Implied Orderblock Breaker (Zeiierman)█  Overview 
The  Implied Order Block Breaker  (Zeiierman) is a tool designed to identify enhanced order blocks with imbalances. These enhanced order blocks represent areas where there is a rapid price movement. Essentially, this indicator uses order blocks and suggests that a swift price movement away from these levels, breaking the current market structure, could indicate an area that the market has not correctly valued. This technique offers traders a unique method to identify potential market inefficiencies and imbalances, serving as a guide for potential price revisits. 
  
The indicator doesn't scan for imbalances in the traditional sense — where there's an absence of trades between two price levels — but instead, it identifies quick movements away from key levels that suggest where an imbalance might exist. Relying on crossovers and cross-unders in conjunction with pivot points and examining the high/low within the same period provides an innovative method for traders to spot these potentially undervalued or overvalued areas in the market. These inferred imbalances can be crucial for traders looking for price levels where the market might make significant moves.
  
█  How It Works 
 Bullish 
 
   Crossover:  The closing price of a bar crosses above a pivot high, which is an indication that buyers are in control and pushing the price upwards.
   New Low Within Period:  There is a lower low within the same period as the pivot high. This suggests that after setting a high, the market pulled back to set a new low, potentially leaving a price gap on the way up as the price quickly recovers.
 
 Bearish  
 
   Crossunder:  The closing price of a bar crosses under a pivot low, indicating that sellers are taking control and driving the price down.
   New High Within Period:  There is a higher high within the same period as the pivot low. This condition suggests that the market rallied to a new high before falling back below the pivot low, potentially leaving a gap on the way down.
 
█  How to Use 
The enhanced order blocks are often revisited, and the price may aim to 'fill' the potential imbalance created by the rapid price movement, thereby presenting traders with potential entry or exit points. This approach aligns with the idea that imbalances are frequently revisited by the market, and when combined with the context of Order Blocks, it provides even more confluence.
  
 Example 
Here, if the price drops rapidly after setting a new high—crossing under the pivot low—it may skip over certain price levels, creating a 'gap' that signifies an area where the price might have been overvalued (imbalance), which the market may revisit for a potential price correction or revaluation.
  
█  Settings 
 
   Period:  Determines the number of bars used for identifying pivot highs and lows. A higher value gives more significant but less frequent signals, while a lower value increases sensitivity but might give more false positives.
   Pivot Surrounding:  Specifies the number of candles to analyze around a pivot point. Increasing this value broadens the analysis range, potentially capturing more setups but possibly including less significant ones.
 
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Cari dalam skrip untuk "high low"
Donch +This is an indicator I made for trading Forex to help me see the bigger picture. It is meant for the 30min TF and it includes the following:
- 20 Day High | Low
- 5 Day High | Low
- 4 Hour High | L
- 4 Hour Bars
- Daily Simple Moving Averages
- Weekly Trend Line (connects last week's open to this week's open)
- Daily Trend Line (connects yesterday's open to today's open)
- Horizontal Lines at 0.25% increments (these can be useful for S/R... currency rarely moves more than 1% in a day).
- A table with information about what markets are open and technicals on the pair I am looking at.
- A slight white background fill to highlight the first hour of the US session. Knowing what session you are in is very important in day trading (in my opinion). This lets me go back and see how the US has been trading.
To keep the chart from being "too busy" (it's plenty busy lol), I use a step line and focus on 30min closes. I reference the white lines above and below closes for 4hr highs/lows and don't bother with looking at the high/low of every 30 min bar.
For the table, you will see bright green by the country for the first hour of trading in that session. It will turn to a regular green after the first hour. It will turn yellow the final hour of that session. It will turn red if that market is closed.
You can select from the settings 'inputs' tab to enable/disable any parts of this you don't find useful, for the table you'd go over to the 'style' tab and unselect it there. For example, I don't use the labels regularly. If I were to get confused about what a moving average was or something, I'd enable the labels and clarify.
Currency doesn't like to break out and likes to be stable. Keeping this in mind, you can see how the 20 day high / low and the 5 day high / low act as support and resistance (unless there is a news event to break out on. 
I have alerts for the following:
- Price update every hour
- Crossing a trend line
- Crossing a moving average
- Crossing a 0.25% increment
- Making a new 4 hour, 5 day, or 20 day high/low
To enable the alerts, you would click add alert, select the indicator, and click save. To work properly, you'd want to be on the 30min TF before doing this. You will get a lot of alerts (personally I like this because I like to see how currency moves throughout the day). You will get one notification per 30 minutes but not more than that for the particular alert.
Machine Learning: VWAP [YinYangAlgorithms]Machine Learning: VWAP aims to use Machine Learning to Identify the best location to Anchor the VWAP at. Rather than using a traditional fixed length or simply adjusting based on a Date / Time; by applying Machine Learning we may hope to identify crucial areas which make sense to reset the VWAP and start anew. VWAP’s may act similar to a Bollinger Band in the sense that they help to identify both Overbought and Oversold Price locations based on previous movements and help to identify how far the price may move within the current Trend. However, unlike Bollinger Bands, VWAPs have the ability to parabolically get quite spaced out and also reset. For this reason, the price may never actually go from the Lower to the Upper and vice versa (when very spaced out; when the Upper and Lower zones are narrow, it may bounce between the two). The reason for this is due to how the anchor location is calculated and in this specific Indicator, how it changes anchors based on price movement calculated within Machine Learning.
This Indicator changes the anchor if the Low < Lowest Low of a length of X and likewise if the High > Highest High of a length of X. This logic is applied within a Machine Learning standpoint that likewise amplifies this Lookback Length by adding a Machine Learning Length to it and increasing the lookback length even further.
Due to how the anchor for this VWAP changes, you may notice that the Basis Line (Orange) may act as a Trend Identifier. When the Price is above the basis line, it may represent a bullish trend; and likewise it may represent a bearish trend when below it. You may also notice what may happen is when the trend occurs, it may push all the way to the Upper or Lower levels of this VWAP. It may then proceed to move horizontally until the VWAP expands more and it may gain more movement; or it may correct back to the Basis Line. If it corrects back to the basis line, what may happen is it either uses the Basis Line as a Support and continues in its current direction, or it will change the VWAP anchor and start anew.
 Tutorial: 
  
If we zoom in on the most recent VWAP we can see how it expands. Expansion may be caused by time but generally it may be caused by price movement and volume. Exponential Price movement causes the VWAP to expand, even if there are corrections to it. However, please note Volume adds a large weighted factor to the calculation; hence Volume Weighted Average Price (VWAP).
   
If you refer to the white circle in the example above; you’ll be able to see that the VWAP expanded even while the price was correcting to the Basis line. This happens due to exponential movement which holds high volume. If you look at the volume below the white circle, you’ll notice it was very large; however even though there was exponential price movement after the white circle, since the volume was low, the VWAP didn’t expand much more than it already had.
  
There may be times where both Volume and Price movement isn’t significant enough to cause much of an expansion. During this time it may be considered to be in a state of consolidation. While looking at this example, you may also notice the color switch from red to green to red. The color of the VWAP is related to the movement of the Basis line (Orange middle line). When the current basis is > the basis of the previous bar the color of the VWAP is green, and when the current basis is < the basis of the previous bar, the color of the VWAP is red. The color may help you gauge the current directional movement the price is facing within the VWAP.
  
You may have noticed there are signals within this Indicator. These signals are composed of Green and Red Triangles which represent potential Bullish and Bearish momentum changes. The Momentum changes happen when the Signal Type: 
 
 The High/Low or Close (You pick in settings)
 
Crosses one of the locations within the VWAP.
Bullish Momentum change signals occur when :
 
 Signal Type crosses OVER the Basis
 Signal Type crosses OVER the lower level
 
Bearish Momentum change signals occur when:
 
 Signal Type crosses UNDER the Basis
 Signal Type Crosses UNDER the upper level
 
These signals may represent locations where momentum may occur in the direction of these signals. For these reasons there are also alerts available to be set up for them.
  
If you refer to the two circles within the example above, you may see that when the close goes above the basis line, how it mat represents bullish momentum. Likewise if it corrects back to the basis and the basis acts as a support, it may continue its bullish momentum back to the upper levels again. However, if you refer to the red circle, you’ll see if the basis fails to act as a support, it may then start to correct all the way to the lower levels, or depending on how expanded the VWAP is, it may just reset its anchor due to such drastic movement.
  
You also have the ability to disable Machine Learning by setting ‘Machine Learning Type’ to ‘None’. If this is done, it will go off whether you have it set to:
 
 Bullish
 Bearish
 Neutral
 
For the type of VWAP you want to see. In this example above we have it set to ‘Bullish’. Non Machine Learning VWAP are still calculated using the same logic of if low < lowest low over length of X and if high > highest high over length of X.
Non Machine Learning VWAP’s change much quicker but may also allow the price to correct from one side to the other without changing VWAP Anchor. They may be useful for breaking up a trend into smaller pieces after momentum may have changed.
  
Above is an example of how the Non Machine Learning VWAP looks like when in Bearish. As you can see based on if it is Bullish or Bearish is how it favors the trend to be and may likewise dictate when it changes the Anchor.
  
When set to neutral however, the Anchor may change quite quickly. This results in a still useful VWAP to help dictate possible zones that the price may move within, but they’re also much tighter zones that may not expand the same way.
We will conclude this Tutorial here, hopefully this gives you some insight as to why and how Machine Learning VWAPs may be useful; as well as how to use them.
 Settings: 
VWAP:
 
 VWAP Type: Type of VWAP. You can favor specific direction changes or let it be Neutral where there is even weight to both. Please note, these do not apply to the Machine Learning VWAP.
  Source: VWAP Source. By default VWAP usually uses HLC3; however OHLC4 may help by providing more data.
 Lookback Length: The Length of this VWAP when it comes to seeing if the current High > Highest of this length; or if the current Low is < Lowest of this length.
 Standard VWAP Multiplier: This multiplier is applied only to the Standard VWMA. This is when 'Machine Learning Type' is set to 'None'.
 
Machine Learning:
 
 Use Rational Quadratics: Rationalizing our source may be beneficial for usage within ML calculations.
 Signal Type: Bullish and Bearish Signals are when the price crosses over/under the basis, as well as the Upper and Lower levels. These may act as indicators to where price movement may occur.
 Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
 KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
 Machine Learning Length: How far back is our Machine Learning going to keep data for.
 k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
 Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
 Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
 
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
YinYang Bar ForecastOverview:
YinYang Bar Forecast is a prediction indicator. It predicts the movement for High, Low, Open and Close for up to 13 bars into the future. We created this Indicator as we felt the TradingView community could benefit from a bar forecast as there wasn’t any currently available.
Our YinYang Bar Forecast is something we plan on continuously working on to better improve it, but at its current state it is still very useful and decently accurate. It features many calculations to derive what it thinks the future bars will hold. Let’s discuss some of the logic behind it:
 
 Each bar has its High, Low, Open and Close calculated individually for highest accuracy. Within these calculations we first check which bar it is we are calculating and base our span back length that we are getting our data from based on the bar index we are generating. This helps us get a Moving Average for this bar index.
 We take this MA and we apply our Custom Volume Filter calculation on it, which is essentially us dividing the current bars volume over the average volume in the last ‘Filtered Length’ (Setting) length. We take this decimal and multiply it on our MA and smooth it out with a VWMA.
 We take the new Volume Filtered MA and apply a RSI Filter calculation on it. RSI Filter is where we take the difference between the high and low of this bar and we multiply it with an RSI calculation using our Volume Filtered MA. We take the result of that multiplication and either add or subtract it from the Volume Filtered MA based on if close > open. This makes our RSI Filtered MA.
 Next, we do an EMA Strength Calculation which is where we check if close > ema(close, ‘EMA Averaged Length’) (Setting). Based on this condition we assign a multiplier that is applied to our RSI Filtered MA. We divide by how many bars we are predicting and add a bit to each predictive bar so that the further we go into the future the stronger the strength is.
 Next we check RSI and RSI MA levels and apply multiplications based on its RSI levels and if it is greater than or less than the MA. Also it is affected by if the RSI is <= 30 and >= 70. 
 Finally we check the MFI and MFI MA levels and like RSI we apply multiplications based on its MFI levels and if it is greater than or less than the MA. It is also affected by if the MFI is <= 30 and >= 70.
 
Please note the way we calculate this may change in the future, this is just currently what we deemed works best for forecasting the future bars. Also note this script uses MA calculations out of scope for efficiency but there is potential for inconsistencies.
Innately it’s main use is the projection it provides. It only draws the bars for realtime bars and not historical ones, so the best way to backtest it is with TradingView’s Replay Tool.
Well, enough of the logic behind it, let's get to understanding how to use it:
Tutorial:
  
So unfortunately we aren’t able to plot legit bars/candles into the future so we’ve had to do a bit of a work around using lines and fills. As you can see here we have 4 Lines and 3 Zones:
Lines:
 
 Green: Represents the High
 Orange: Represents the Open
 Teal: Represents the Close
 Red: Represents the Low
 
Zones:
 
 High Zone: This zone is from either Open or Close to the High and is ALWAYS filled with Green.
 Open/Close Zone: This zone is from the Open to the Close and is filled with either Green or Red based on if it's greater than the previous bar (real or forecasted).
 Low Zone: This zone is from either Open or Close to the Low and is ALWAYS filled with Red.
 
  
As you can see generally the Forecasted bars are generally within strong pivot locations and are a good estimation of what will likely go on. Please note, the WHOLE structure of the prediction can change based on the current bars movements and the way it affects the calculations.
Let's look 1 bar back from the current bar just so we can see what it used to Forecast:
  
As you can see it has changed quite a bit from the previous bar, but if you look close, we drew horizontal lines around where its projecting the next bar to be (our current realtime bar), if we go back to the live chart:
  
Its projections were pretty close for the high and low. Generally, right now at least, it does a much better job at predicting the high and low than it does the open and close, however we will do our best to fine tune that in future updates.
Remember, this indicator is not meant to base your trades on, but rather give you a Forecast towards the general direction of the next few bars. Somewhat like weather, the farther the bar (or day for weather), the harder it is to predict. For this reason we recommend you focusing on the first few bars as they are more accurate, but review the further ones as they may help show the trend and the way that pair will move.
We will conclude this tutorial here, hopefully this Predictive Indicator can be of some help and use to you. If you have any questions, comments, ideas or concerns please let us know.
Settings:
 
 Forecast Length: How many bars should we predict into the Future? Max 13
 Each Bar Length Multiplier: For each new Forecast bar, how many more bars are averaged? Min 2
 VWMA Averaged Length: All Forecast bars are put into a VWMA, what length should we use?
 EMA Averaged Length: All Forecast bars are put into a EMA, what length should we use?
 Filtered Length: What length should we use for Filtered Volume and RSI?
 EMA Strength Length: What length should we use for the EMA Strength
 
HAPPY TRADING!
Major and Minor Trend Indicator by Nikhil34a V 2.2Title: Major and Minor Trend Indicator by Nikhil34a V 2.2 
Description:
The Major and Minor Trend Indicator v2.2 is a comprehensive technical analysis script designed for use with the TradingView platform. This powerful tool is developed in Pine Script version 5 and helps traders identify potential buying and selling opportunities in the stock market.
Features:
SMA Trend Analysis: The script calculates two Simple Moving Averages (SMAs) with user-defined lengths for major and minor trends. It displays these SMAs on the chart, allowing traders to visualize the prevailing trends easily.
Surge Detection: The indicator can detect buying and selling surges based on specific conditions, such as volume, RSI, MACD, and stochastic indicators. Both Buying and Selling surges are marked in black on the chart.
Option Buy Zone Detection: The script identifies the option buy zone based on SMA crossovers, RSI, and MACD values. The buy zone is categorized as "CE Zone" or "PE Zone" and displayed in the table along with the trigger time.
Two-Day High and Low Range: The script calculates the highest high and lowest low of the previous two trading days and plots them on the chart. The area between these points is shaded in semi-transparent green and red colors.
Crossover Analysis: The script analyzes moving average crossovers on multiple timeframes (2-minute, 3-minute, and 5-minute) and displays buy and sell signals accordingly.
Trend Identification: The script identifies the major and minor trends as either bullish or bearish, providing valuable insights into the overall market sentiment.
Usage:
Customize Major and Minor SMA Periods: Adjust the lengths of major and minor SMAs through input parameters to suit your trading preferences.
Enable/Disable Moving Averages: Choose which SMAs to display on the chart by toggling the "showXMA" input options.
Set Surge and Option Buy Zone Thresholds: Modify the surgeThreshold, volumeThreshold, RSIThreshold, and StochThreshold inputs to refine the surge and buy zone detection.
Analyze Crossover Signals: Monitor the crossover signals in the table, categorized by timeframes (2-minute, 3-minute, and 5-minute).
Explore Market Bias and Distance to 2-Day High/Low: The table provides information on market bias, current price movement relative to the previous two-day high and low, and the option buy zone status.
Additional Use Cases:
Surge Indicator:
The script includes a Surge Indicator that detects sudden buying or selling surges in the market. When a buying surge is identified, the "BSurge" label will appear below the corresponding candle with black text on a white background. Similarly, a selling surge will display the "SSurge" label in white text on a black background. These indicators help traders quickly spot strong buying or selling activities that may influence their trading decisions. These surges can be used to identify sudden premium dump zones.
Option Buy Zone:
The Option Buy Zone is an essential feature that identifies potential zones for buying call options (CE Zone) or put options (PE Zone) based on specific technical conditions. The indicator evaluates SMA crossovers, RSI, and MACD values to determine the current market sentiment. When the option buy zone is triggered, the script will display the respective zone ("CE Zone" or "PE Zone") in the table, highlighted with a white background. Additionally, the time when the buy zone was triggered will be shown under the "Option Buy Zone Trigger Time" column.
Price Movement Relative to 2-Day High/Low:
The script calculates the highest high and lowest low of the previous two trading days (high2DaysAgo and low2DaysAgo) and plots these points on the chart. The area between these two points is shaded in semi-transparent green and red colors. The green region indicates the price range between the highpricetoconsider (highest high of the previous two days) and the lower value between highPreviousDay and high2DaysAgo. Similarly, the red region represents the price range between the lowpricetoconsider (lowest low of the previous two days) and the higher value between lowPreviousDay and low2DaysAgo.
Entry Time and Current Zone:
The script identifies potential entry times for trades within the option buy zone. When a valid buy zone trigger occurs, the script calculates the entryTime by adding the durationInMinutes (user-defined) to the startTime. The entryTime will be displayed in the "Entry Time" column of the table. Depending on the comparison between optionbuyzonetriggertime and entryTime, the background color of the entry time will change. If optionbuyzonetriggertime is greater than entryTime, the background color will be yellow, indicating that a new trigger has occurred before the specified duration. Otherwise, the background color will be green, suggesting that the entry time is still within the defined duration.
Current Zone Indicator:
The script further categorizes the current zone as either "CE Zone" (call option zone) or "PE Zone" (put option zone). When the market is trending upwards and the minor SMA is above the major SMA, the currentZone will be set to "CE Zone." Conversely, when the market is trending downwards and the minor SMA is below the major SMA, the currentZone will be "PE Zone." This information is displayed in the "Current Zone" column of the table.
These additional use cases empower traders with valuable insights into market trends, buying and selling surges, option buy zones, and potential entry times. Traders can combine this information with their analysis and risk management strategies to make informed and confident trading decisions.
 Note:
The script is optimized for identifying trends and potential trade opportunities. It is crucial to perform additional analysis and risk management before executing any trades based on the provided signals.
Happy Trading!
Open Price Regression Modelnput Variables: The user can adjust the lookbackPeriod and m (multiplier) inputs. The lookbackPeriod specifies the number of previous bars used for regression calculations, and m is used to calculate the confidence interval width.
Calculate Regression Model: The code extracts open, high, low, and close prices for the current candle. It then performs regression calculations for high, low, and close prices based on the open prices.
Calculate Predicted Prices: Using the regression coefficients and intercepts, the code calculates predicted high, low, and close prices based on the current open price.
Calculate Confidence Interval: The code computes the standard errors of the regression for high, low, and close prices and multiplies them by the specified confidence level multiplier (m) to determine the width of the confidence intervals.
Plotting: The predicted high, low, and close prices are plotted with different colors. Additionally, confidence intervals are plotted around the predicted prices using lines.
Implications and Trading Advantage:
The Open Price Regression Model aims to predict future high, low, and close prices based on the current open price. Traders can use the predicted values and confidence intervals as potential price targets and volatility measures. Traders can consider taking long or short positions based on whether the current open price is below or above the predicted prices. Can be used on a daily time frame to forecast the day's high and low and use this levels are horizontal price levels on lower timeframes. 
HILOCLOP AnalysisThe "HILOCLOP Analysis" indicator is designed to analyze price data based on different conditions and provide insights into market trends and patterns. Let's break down its features and understand its potential usefulness in trading:
Sample Length: The indicator allows the user to specify the sample length, which determines the number of bars or periods considered for the analysis. This parameter can be adjusted to capture short-term or long-term trends and patterns in the market.
Raw Up/Down Analysis: The indicator calculates the number of occurrences where the current price values (high, low, open, close) are higher or lower than their previous values. It provides separate counts for each price component. By visualizing these counts on the chart, traders can identify periods of upward or downward movement in the price data.
HICLOP Analysis: The indicator offers a color scheme option called "HICLOP," which determines the color of the plotted results. If the HICLOP analysis is enabled, the plots representing raw up/down counts will have different colors based on whether the current count is higher or lower than the previous count. This color coding helps traders quickly identify changes in price trends.
Unchecking this Box will Show the general trend.
 Raw HICLOP Color Scheme
  
 Trend Color Scheme
  
Analysis Up vs. Down: The indicator provides an option to analyze instances where all four price components (high, low, open, close) are higher or lower than their respective previous values. This analysis helps traders identify periods of strong upward or downward movement in the market.
  
Analysis High vs. Low: The indicator compares the number of occurrences where the current high is higher than the previous high and the current low is higher than the previous low. It provides insights into whether the market is experiencing higher highs or higher lows, which can help traders determine the strength of an upward or downward trend.
  
Analysis Open vs. Close: The indicator compares the number of occurrences where the current close is higher than the previous close and the current open is higher than the previous open. This analysis helps traders assess the relationship between opening and closing prices, providing insights into the strength of buying or selling pressure in the market.
  
The usefulness of the "HILOCLOP Analysis" indicator in trading depends on the specific trading strategy and the trader's preferences. Here are a few potential use cases:
Trend Identification: By analyzing the raw up/down counts and the HICLOP color scheme, traders can identify trends and changes in price momentum. Increasing raw up counts and corresponding color changes to positive values may indicate an upward trend, while increasing raw down counts and negative color changes may suggest a downward trend.
Confirmation of Breakouts: Traders often look for confirmation of breakouts from key levels or chart patterns. The "Analysis Up V Dn" feature can help identify instances where all four price components simultaneously confirm a breakout, indicating a potentially significant move in the market.
Trend Reversals: The "Analysis High V Low" and "Analysis Open V Close" features can provide insights into potential trend reversals. For example, if there are more higher highs than higher lows, it may indicate a weakening trend, potentially signaling a reversal or a correction.
MACD Normalized [ChartPrime]Overview of MACD Normalized Indicator 
The MACD Normalized indicator, serves as an asset for traders seeking to harness the power of the moving average convergence divergence (MACD) combined with the advantages of the stochastic oscillator. This novel indicator introduces a normalized MACD, offering a potentially enhanced flexibility and adaptability to numerous market conditions and trading techniques.
This indicator stands out by normalizing the MACD to its average high and average low, also factoring in the deviation of the high-low position from the mean. This approach incorporates the high and low in the calculations, providing the benefits of stochastic without its common drawbacks, such as clipping problems. As a result, the indicator becomes exceptionally versatile and suitable for various trading strategies, including both faster and slower settings.
The MACD Normalized Indicator boasts a variety of options and settings. The features include:
 
 Enable Ribbon: Toggle the display of the ribbon accompanying the MACD Normalized, as desired.
 Fast Length: Determine the movement speed of the fast line to receive advance notice of potential market opportunities.
 Slow Length: Control the movement pace of the slow line for smoother signals and a comprehensive outlook on market trends.
 Average Length: Specify the length used to calculate the high and low averages, providing greater control over the indicator's granularity.
 Upper Deviation: Establish the extent to which the high and low values deviate from the mean, ensuring adaptability to diverse market situations.
 Inner Band (Middle Deviation): Adjust the balance between the high and low deviations to create an inner band signal, giving traders a secondary level of market analysis and decision-making support.
 Enable Candle Color: Enable the coloring of candles based on the MACD Normalized value for effortless visualization of trading potential.
 
 Use Cases for the MACD Normalized Indicator 
In addition to analyzing market trends and identifying potential trading opportunities, ChartPrime's MACD Normalized Indicator offers a range of applications for traders. These use cases encompass distinct trading scenarios and strategies:
Overbought and Oversold Regions
One of the key applications of the MACD Normalized Indicator is identifying overbought and oversold regions. Overbought refers to a situation where an asset's price has risen significantly and is expected to face a downturn, while oversold indicates a price drop that may subsequently lead to a reversal.
By adjusting the indicator's parameters, such as the upper and inner deviation levels, traders can set precise boundaries to determine overbought and oversold areas. When the MACD moves into the upper region, it may signal that the asset is overbought and due for a price correction. Conversely, if the MACD enters the lower region, it possibly indicates an oversold condition with the potential for a price rebound.
  
Signal Line Crossovers
The MACD Normalized Indicator displays two lines: the fast line and the slow line (inner band). A common trading strategy involves observing the intersection of these two lines, known as a crossover. When the fast line crosses above the slow line, it may signify a bullish trend or a potential buying opportunity. Conversely, a crossover with the fast line moving below the slow line typically indicates a bearish trend or a selling opportunity.
Divergence and Convergence
Divergence occurs when the price movement of an asset does not align with the corresponding MACD values. If the price establishes a new high while the MACD fails to do the same, a bearish divergence emerges, suggesting a potential downtrend. Similarly, a bullish divergence takes place when the price forms a new low but the MACD does not follow suit, hinting at an upcoming uptrend.
Convergence, on the other hand, is represented by the MACD lines moving closer together. This movement signifies a potential change in the trend, providing traders with a timely opportunity to enter or exit the market.
DB Support Resistance LevelsDB Support Resistance Levels 
This indicator plots historic lines for high, low and close prices. The settings allow up to 3 periods to be configured based on the current timeframe. Users can toggle the display of high, low or close values for each period along with customizing the period line color. The indicator does not use the security function. Instead, it's designed to use a period multiplier. Each period allows the user to configure a lookback length and multiplier. 
 For Example on Weekly 
 
 A period lookback of 12 with a multiplier value of 12 on weekly would produce historic high, low and close lines for the last 12 weeks.
 A period lookback of 10 with a multiplier value of 4 on weekly would produce historic high, low and close lines for the last 4, 4-week months. 
 A period lookback of 8 with a multiplier value of 13 on weekly would produce historic high, low and close lines for the last 8, 13-week quarters.
 
 Why not use security with higher timeframe? 
The goal was to have the lines start at the precise high, low and close points for the current chart timeframe to allow the user to visually trace the start of the line.
 What else does this do? 
This indicator also plots the pivot points using TradingView's built-in "pivot_point_levels" feature. 
 How should I use this indicator? 
Traders may use this indicator to gain a visual reference of support and resistance levels from higher periods of time. You can then compare these historic levels against the pivot point levels. In most cases, historic high, low and close levels act as support and resistance levels which can be helpful for judging future market pivot points. 
 Additional Notes 
This indicator does increase the max total lines allowed which may impact performance depending on device specs. No alerts or signals for now. Perhaps coming soon...
Volatility Range Breakout Strategy [wbburgin]The "Volatility Range Breakout Strategy" uses deviations of high-low volatility to determine bullish and bearish breakouts.
HOW IT WORKS
 
  The volatility function uses the high-low range of a lookback period, divided by the average of that range, to determine the likelihood that price will break in a specific direction.
  High and low ranges are determined by the relative volatility compared to the current closing price. The high range, for example, is the (volatility * close) added to the close, the low range is this value subtracted by the close.
  A volatility-weighted moving average is taken of these high and low ranges to form high and low bands.
  Finally, breakouts are identified once the price closes above or below these bands. An upwards breakout (bullish) occurs when the price breaks above the upper band, while a downwards breakout (bearish) occurs when the price breaks below the lower band. Positions can be closed either by when the price falls out of its current band ("Range Crossover" in settings under 'Exit Type') or when the price falls below or above the volatility MA (default because this allows us to catch trends for longer).
 
INPUTS/SETTINGS
The AVERAGE LENGTH is the period for the volatility MA and the weighted volatility bands.
The VOLATILITY LENGTH is how far the lookback should be for highs/lows for the volatility calculation.
Enjoy! Let me know if you have any questions.
Volume-based Support & Resistance Zones-V1 By Trade Mastership™ The all-new Support & Resistance Zones indicator, which has been upgraded to offer traders more powerful features and functionality. This innovative indicator identifies high-volume fractal lows or highs to create zones based on the size of the wick for that timeframe's candle. This makes it easy for traders to visualize which price levels are the most significant for either a trend continuation or a reversal when zones are broken and retested.
The original script for this indicator was created by Trade Mastership, with additional modifications by L N Behera. Credit goes to both of them for the majority of the logic behind this script. Since then, the script has been improved with several changes, including:
Changing the default S/R lines from plots to lines, and giving users the option to change between solid, dashed, or dotted lines for both S/R lines
Adding additional timeframes and more options for TF1, beyond the current TF. Now, users have four timeframes to plot S/R zones from
Giving users the option to easily change the line thickness for all S/R lines
Making it easier to change the colors of S/R lines and zones by consolidating the options under settings (rather than under style)
Adding extensions to active SR Zones to extend all the way right
Adding the option to extend or not extend the previous S/R zones up to the next S/R zone
Adding optional timeframe labels to active S/R zones, with left and right options, as well as the option to adjust how far to the right the label is set
Fixing an issue where the higher timeframe S/R zone was not properly starting from the high/low of fractal. Now, any higher timeframe S/R will begin exactly at the High/Low points. Note that this may not work perfectly on stocks, and if a fractal high/low is too many bars in the past, it will revert to a default max bars back to avoid script errors.
Adding a function to prevent S/R zones from lower timeframes displaying while on a higher timeframe. This helps clean up the chart quite a bit.
Creating arrays for each timeframe's boxes and lines so that the number of S/R zones can be controlled for each timeframe and limit memory consumption.
Adding new alert options and customized alert messages
Here's how this indicator works: it looks for fractal highs or fractal lows with volume that pierces above the volume's Moving Average. This moving average value can be modified in the settings for each timeframe. The fractal highs will be confirmed with three successive higher highs followed by two successive lower highs and vice versa for the fractal lows. The zone is created from the fractal high/low and the close of the candle for whatever timeframe you selected. The bigger the zone, the more significant that zone is.
Traders can disable any zone, change the zones to show lines only, and modify all the colors, transparencies, and thickness of lines for all the zones. To create alerts, traders can enable the types of alerts they want for each timeframe in the indicator's settings. After applying changes, right-click on one of the zones on the chart, and click "Add Alert on Vol S/R Zones." You do not need to add a title, as the correct alert messages are already built-in.
The latest update has migrated the script to Pine Script Version 5 and added a higher number of total boxes/lines to show on the chart. It has also increased the max bars count to the maximum Pine Script allows, enabling traders to utilize as many bars as possible when drawing the left side of SR zones that are very far back on the chart. Additionally, the update fixed issues where the indicator would not load on 1 minute and 3-minute charts unless higher timeframe SR zones
ICT Concepts [LuxAlgo]The ICT Concepts indicator regroups core concepts highlighted by trader and educator "The Inner Circle Trader" (ICT) into an all-in-one toolkit. Features include Market Structure (MSS & BOS), Order Blocks, Imbalances, Buyside/Sellside Liquidity, Displacements, ICT Killzones, and New Week/Day Opening Gaps.
 🔶 SETTINGS 
 🔹 Mode 
 
 When  Present  is selected, only data of the latest 500 bars are used/visualized, except for  NWOG/NDOG 
 
 🔹 Market Structure 
 
 Enable/disable Market Structure.
 Length: will set the lookback period/sensitivity.
 In Present Mode only the latest Market Structure trend will be shown, while in Historical Mode, previous trends will be shown as well:
  
 You can toggle MSS/BOS separately and change the colors:
  
 
 🔹 Displacement  
 
 Enable/disable Displacement.
 
 🔹 Volume Imbalance  
 
 Enable/disable Volume Imbalance.
 # Visible VI's: sets the amount of visible Volume Imbalances (max 100), color setting is placed at the side.
 
 🔹 Order Blocks 
 
 Enable/disable Order Blocks.
 Swing Lookback: Lookback period used for the detection of the swing points used to create order blocks.
 Show Last Bullish OB: Number of the most recent bullish order/breaker blocks to display on the chart.
 Show Last Bearish OB: Number of the most recent bearish order/breaker blocks to display on the chart.
 Color settings.
 Show Historical Polarity Changes: Allows users to see labels indicating where a swing high/low previously occurred within a breaker block.
 Use Candle Body: Allows users to use candle bodies as order block areas instead of the full candle range.
 Change in Order Blocks style:
  
 
 🔹 Liquidity  
 
 Enable/disable Liquidity.
 Margin: sets the sensitivity, 2 points are fairly equal when:
       'point 1' < 'point 2' + (10 bar Average True Range / (10 / margin)) and 
       'point 1' > 'point 2' -   (10 bar Average True Range / (10 / margin))
  
 # Visible Liq. boxes: sets the amount of visible Liquidity boxes (max 50), this amount is for Sellside and Buyside boxes separately.
 Colour settings.
 Change in Liquidity style:
  
 
 🔹 Fair Value Gaps 
 
 Enable/disable FVG's.
 Balance Price Range: this is the overlap of latest bullish and bearish Fair Value Gaps.
     By disabling  Balance Price Range  only FVGs will be shown. 
  
 Options: Choose whether you wish to see FVG or Implied Fair Value Gaps (this will impact  Balance Price Range  as well)
 # Visible FVG's: sets the amount of visible FVG's (max 20, in the same direction).
 Color settings.
 Change in FVG style:
  
 
 🔹 NWOG/NDOG 
 
 Enable/disable NWOG; color settings; amount of NWOG shown (max 50).
 Enable/disable NDOG    ; color settings; amount of NDOG     shown (max 50).
 
 🔹 Fibonacci 
This tool connects the 2 most recent bullish/bearish (if applicable) features of your choice, provided they are enabled.
 
 3 examples (FVG, BPR, OB):
  
 Extend lines -> Enabled (example OB):
  
 
 🔹 Killzones 
 
 Enable/disable all or the ones you need.
 Time settings are coded in the corresponding time zones.
  
 
 🔶 USAGE 
By default, the indicator displays each feature relevant to the most recent price variations in order to avoid clutter on the chart & to provide a very similar experience to how a user would contruct ICT Concepts by hand. 
Users can use the historical mode in the settings to see historical market structure/imbalances. The ICT Concepts indicator has various use cases, below we outline many examples of how a trader could find usage of the features together.
  
In the above image we can see price took out Sellside liquidity, filled two bearish FVGs, a market structure shift, which then led to a clean retest of a bullish FVG as a clean setup to target the order block above.
  
Price then fills the OB which creates a breaker level as seen in yellow.
  
Broken OBs can be useful for a trader using the ICT Concepts indicator as it marks a level where orders have now been filled, indicating a solidified level that has proved itself as an area of liquidity. In the image above we can see a trade setup using a broken bearish OB as a potential entry level.
  
We can see the New Week Opening Gap (NWOG) above was an optimal level to target considering price may tend to fill / react off of these levels according to ICT.
  
In the next image above, we have another example of various use cases where the ICT Concepts indicator hypothetically allow traders to find key levels & find optimal entry points using market structure.
  
In the image above we can see a bearish Market Structure Shift (MSS) is confirmed, indicating a potential trade setup for targeting the Balanced Price Range imbalance (BPR) below with a stop loss above the buyside liquidity.
  
Although what we are demonstrating here is a hindsight example, it shows the potential usage this toolkit gives you for creating trading plans based on ICT Concepts.
  
Same chart but playing out the history further we can see directly after price came down to the Sellside liquidity & swept below it...
  
Then by enabling IFVGs in the settings, we can see the IFVG retests alongside the Sellside & Buyside liquidity acting in confluence.
  
Which allows us to see a great bullish structure in the market with various key levels for potential entries.
  
Here we can see a potential bullish setup as price has taken out a previous Sellside liquidity zone and is now retesting a NWOG + Volume Imbalance.
  
Users also have the option to display Fibonacci retracements based on market structure, order blocks, and imbalance areas, which can help place limit/stop orders more effectively as well as finding optimal points of interest beyond what the primary ICT Concepts features can generate for a trader.
In the above image we can see the Fibonacci extension was selected to be based on the NWOG giving us some upside levels above the buyside liquidity.
 🔶 DETAILS 
Each feature within the ICT Concepts indicator is described in the sub sections below.
 🔹 Market Structure 
Market structure labels are constructed from price breaking a prior swing point. This allows a user to determine the current market trend based on the price action.
There are two types of Market Structure labels included:
 
 Market Structure Shift (MSS)
 Break Of Structure (BOS)
 
A MSS occurs when price breaks a swing low in an uptrend or a swing high in a downtrend, highlighting a potential reversal. This is often labeled as "CHoCH", but ICT specifies it as MSS.
On the other hand, BOS labels occur when price breaks a swing high in an uptrend or a swing low in a downtrend. The occurrence of these particular swing points is caused by retracements (inducements) that highlights liquidity hunting in lower timeframes.
 🔹 Order Blocks 
More significant market participants (institutions) with the ability of placing large orders in the market will generally place a sequence of individual trades spread out in time. This is referred as executing what is called a "meta-order".
Order blocks highlight the area where potential meta-orders are executed. Bullish order blocks are located near local bottoms in an uptrend while bearish order blocks are located near local tops in a downtrend.
When price mitigates (breaks out) an order block, a breaker block is confirmed. We can eventually expect price to trade back to this breaker block offering a new trade opportunity.
 🔹 Buyside & Sellside Liquidity 
Buyside / Sellside liquidity levels highlight price levels where market participants might place limit/stop orders. 
Buyside liquidity levels will regroup the stoploss orders of short traders as well as limit orders of long traders, while Sellside liquidity levels will regroup the stoploss orders of long traders as well as limit orders of short traders.
These levels can play different roles. More informed market participants might view these levels as source of liquidity, and once liquidity over a specific level is reduced it will be found in another area.
 🔹 Imbalances 
Imbalances highlight disparities between the bid/ask, these can also be defined as inefficiencies, which would suggest that not all available information is reflected by the price and would as such provide potential trading opportunities.
It is common for price to "rebalance" and seek to come back to a previous imbalance area.
ICT highlights multiple imbalance formations:
 
 Fair Value Gaps: A three candle formation where the candle shadows adjacent to the central candle do not overlap, this highlights a gap area.
 Implied Fair Value Gaps: Unlike the fair value gap the implied fair value gap has candle shadows adjacent to the central candle overlapping. The gap area is constructed from the average between the respective shadow and the nearest extremity of their candle body. 
 Balanced Price Range: Balanced price ranges occur when a fair value gap overlaps a previous fair value gap, with the overlapping area resulting in the imbalance area.
 Volume Imbalance: Volume imbalances highlight gaps between the opening price and closing price with existing trading activity (the low/high overlap the previous high/low).
 Opening Gap: Unlike volume imbalances opening gaps highlight areas with no trading activity. The low/high does not reach previous high/low, highlighting a "void" area.
 
 🔹 Displacement 
Displacements are scenarios where price forms successive candles of the same sentiment (bullish/bearish) with large bodies and short shadows. 
These can more technically be identified by positive auto correlation (a close to open change is more likely to be followed by a change of the same sign) as well as volatility clustering (large changes are followed by large changes).
Displacements can be the cause for the formation of imbalances as well as market structure, these can be caused by the full execution of a meta order.
 🔹 Kill Zones 
Killzones represent different time intervals that aims at offering optimal trade entries. Killzones include:
- New York Killzone (7:9 ET)
- London Open Killzone (2:5 ET)
- London Close Killzone (10:12 ET)
- Asian Killzone (20:00 ET)
 🔶 Conclusion & Supplementary Material 
This script aims to emulate how a trader would draw each of the covered features on their chart in the most precise representation to how it's actually taught by ICT directly. 
There are many parallels between ICT Concepts and Smart Money Concepts that we released in 2022 which has a more general & simpler usage:   
ICT Concepts, however, is more specifically aligned toward the community's interpretation of how to analyze price 'based on ICT', rather than displaying features to have a more classic interpretation for a technical analyst.
Candle Trend Counter [theEccentricTrader]█   OVERVIEW 
This indicator counts the number of confirmed candle trend scenarios on any given candlestick chart and displays the statistics in a table, which can be repositioned and resized at the user's discretion.
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a high price equal to or above the price it opened.
• A red candle is one that closes with a low price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough. 
 Muti-Part Green and Red Candle Trends 
• A multi-part green candle trend begins upon the completion of a swing low and continues until a red candle completes the swing high, with each green candle counted as a part of the trend.
• A multi-part red candle trend begins upon the completion of a swing high and continues until a green candle completes the swing low, with each red candle counted as a part of the trend.
█   FEATURES 
 Inputs 
    Start Date
    End Date
    Position
    Text Size
    Show Sample Period
    Show Plots
 Table 
The table is colour coded, consists of seven columns and, as many as, thirty-one rows. Blue cells denote the multi-part candle trend scenarios, green cells denote the corresponding green candle trend scenarios and red cells denote the corresponding red candle trend scenarios.
The candle trend scenarios are listed in the first column with their corresponding total counts to the right, in the second column. The last row in column one, displays the sample period which can be adjusted or hidden via indicator settings.
The third column displays the total candle trend scenarios as percentages of total 1-candle trends, or complete swing highs and swing lows. And column four displays the total candle trend scenarios as percentages of the, last, or preceding candle trend part. For example 4-candle trends as a percentage of 3-candle trends. This offers more insight into what might happen next at any given point in time. 
 Plots 
I have added plots as a visual aid to the various candle trend scenarios listed in the table. Green up-arrows, with the number of the trend part, denote green candle trends. Red down-arrows, with the number of the trend part, denote red candle trends.
█   HOW TO USE 
This indicator is intended for research purposes, strategy development and strategy optimisation. I hope it will be useful in helping to gain a better understanding of the underlying dynamics at play on any given market and timeframe. 
It can, for example, give you an idea of whether the next candle will close higher or lower than it opened, based on the current scenario and what has happened in the past under similar circumstances. Such information can be very useful when conducting top down analysis across multiple timeframes and making strategic decisions.
What you do with these statistics and how far you decide to take your research is entirely up to you, the possibilities are endless.
█   LIMITATIONS 
Some higher timeframe candles on tickers with larger lookbacks such as the DXY , do not actually contain all the open, high, low and close (OHLC) data at the beginning of the chart. Instead, they use the close price for open, high and low prices. So, while we can determine whether the close price is higher or lower than the preceding close price, there is no way of knowing what actually happened intra-bar for these candles. And by default candles that close at the same price as the open price, will be counted as green. You can avoid this problem by utilising the sample period filter.
The green and red candle calculations are based solely on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with. Alternatively, you can replace the scenarios with your own logic to account for the gap anomalies, if you are feeling up to the challenge.
It is also worth noting that the sample size will be limited to your Trading View subscription plan. Premium users get 20,000 candles worth of data, pro+ and pro users get 10,000, and basic users get 5,000. If upgrading is currently not an option, you can always keep a rolling tally of the statistics in an excel spreadsheet or something of the like. 
Pullback IndicatorThe Pullback Indicator is a technical analysis tool designed to identify pullbacks in the price action of a financial instrument. It is based on the concept that price tends to retrace to a previous level of support or resistance before continuing in the direction of the trend.
The indicator is plotted as a series of triangles above or below the price bars, depending on the type of pullback detected. A green triangle is displayed when a bullish pullback is detected, while a red triangle is displayed for a bearish pullback.
The Pullback Indicator uses Inside Bar Range, this number is a user-defined input that specifies the number of bars to look back for the highest high and lowest low.
The indicator classifies four types of pullbacks:
 
 Swing Low - When the price forms a lower low and a higher low than the previous bar.
 Swing High - When the price forms a higher high and a lower high than the previous bar.
 High Low Sweep and close below - When the price forms a lower low and a higher low than the previous bar, but the close is below the previous high.
 High Low Sweep and close above - When the price forms a higher high and a lower high than the previous bar, but the close is above the previous low.
 
The Pullback Indicator is best used in conjunction with other technical analysis tools to confirm the direction of the trend and to identify potential entry and exit points.
Inter-Exchanges Crypto Price Spread Clouds (Tartigradia)Display variations in min-max and median values of high, low and close across exchanges. It's a kind of realized volatility indicator, as the idea is that in times of high volatility (high emotions, fear, uncertainty), it's more likely that market inefficiencies will appear for the same asset between different market makers, ie, the price can temporarily differ a lot. This indicator will catch these instants of high differences between exchanges, even if they lasted only an instant (because we use high and low values).
Compared with my other "Inter-Exchanges Crypto Price Spread Deviation" indicator, this one overlays directly on the chart, and offers a different take based on the same premisses. Instead of summarizing volatility via standard deviation, here we display clouds of the range of values that were observed.
A big advantage of this approach is that it can also be used to determine safe stop loss levels, especially the values of percentile rank (i.e., what are the high values that were observed in at least 50% of exchanges?).
Indeed, all price levels are displayed in the indicator's status bar:
 
  green for high values,
  red for low values,
  aqua for median,
  purple for average,
  The first two values are max and min values of high across exchanges (in green).
  The next two values are max and min of low across exchanges (in red).
  The next two values are median (aqua) and average (purple).
  The last two values are percentile rank values for high (green) and low (red) respectively.
 
Another advantage is that the high (green) vs low (red) clouds can be seen as representing the buying or selling pressure respectively across exchanges, and this may in itself provide a signal to know whether one side is winning.
Link to my other complementary indicator: 
Compared to other inter-exchanges spread indicators, this one offers two major features:
 
  The symbol automatically adapts to the symbol currently selected in user's chart. Hence, switching between tickers does not require the user to modify any option, everything is dynamically updated behind the scenes.
  It's easy to add more exchanges (requires some code editing because PineScript v5 does not allow dynamical request.security() calls).
 
Limitations/things to know:
 
  History is limited to what the ticker itself display. Ie, even if the exchanges specified in this indicator have more data than the ticker currently displayed in the user's chart, the indicator will show only a timeperiod as long as the chart.
  The indicator can manage multiple exchanges of different historical length (ie, some exchanges having more data going way earlier in the past than others), in which case they will simply be ignored from calculations when far back in the past. Hence, you should be aware that the further you go in the past, the less exchanges will have such data, and hence the less accurate the measures will be (because the deviation will be calculated from less sources than more recent bars). This is thanks to how the array.* math functions behave in case of na values, they simply skip them from calculations, contrary to math.* functions.
Channel Based Zigzag [HeWhoMustNotBeNamed]🎲 Concept
Zigzag is built based on the price and number of offset bars. But, in this experiment, we build zigzag based on different bands such as Bollinger Band, Keltner Channel and Donchian Channel. The process is simple:
🎯 Derive bands based on input parameters
🎯 High of a bar is considered as pivot high only if the high price is above or equal to upper band.
🎯 Similarly low of a bar is considered as pivot low only if low price is below or equal to lower band.
🎯 Adding the pivot high/low follows same logic as that of regular zigzag where pivot high is always followed by pivot low and vice versa.
🎯 If the new pivot added is of same direction as that of last pivot, then both pivots are compared with each other and only the extreme one is kept. (Highest in case of pivot high and lowest in case of pivot low)
🎯 If a bar has both pivot high and pivot low - pivot with same direction as previous pivot is added to the list first before adding the pivot with opposite direction.
🎲 Use Cases
Can be used for pattern recognition algorithms instead of standard zigzag. This will help derive patterns which are relative to bands and channels.
Example: John Bollinger explains how to manually scan double tap using Bollinger Bands in this video: www.youtube.com This modified zigzag base can be used to achieve the same using algorithmic means.
🎲 Settings
Few simple configurations which will let you select the band properties. Notice that there is no zigzag length here. All the calculations depend on the bands.
With bands display, indicator looks something like this
Note that pivots do not always represent highest/lowest prices. They represent highest/lowest price relative to bands.
As mentioned many times, application of zigzag is not for buying at lower price and selling at higher price. It is mainly used for pattern recognition either manually or via algorithms. Lets build new Harmonic, Chart patterns, Trend Lines using the new zigzag?
Micro ZigzagMicro zigzag is created based on similar concepts as that of zigzag but by using lower timeframe intra-bar data. The lines join candle's high/low points but also depict how the price movement within the candle happened. That is, if the high of the candle is reached first, pivot from previous candle join the high first and then low and vice versa.
The output can also be viewed as advanced line chart.
 🎲 Process 
🎯 For every bar identify whether high came first or low by using lower timeframe data.
🎯 If high came before low, add high as high pivot first and then low as low pivot. If otherwise, add low as lower pivot first and then high as higher pivot.
🎯 When adding pivot, check if the last pivot is in the same direction as the new one. If yes, replace existing pivot if the new one goes beyond it. Ignore otherwise.
🎯 If the last pivot is of different direction as that one new one, then simple add the new pivot.
Volume-based Support & Resistance ZonesThe new and improved Support & Resistance Zones indicator is here. This indicator is based on high volume at fractal lows or fractal highs with the zones based on the size of the wick for that timeframe’s candle. 
This helps traders visualize which price levels are of the most significance for either reversals or continuation of the trend when zones are broken and then re-tested.
Original script is thanks to synapticex and additional modifications is thanks to Lij_MC. Credit to both of them for most of the logic behind this script. 
Since then I have made many changes to this script as noted below:
 
  Changed default S/R lines from plots to lines, and gave option to user to change between solid line, dashed line, or dotted line for both S/R lines.
  Added additional time frame and gave more TF options for TF1 other than current TF. Now you will have 4 time frames to plot S/R zones from.
  Gave user option to easily change line thickness for all S/R lines.
  Made it easier to change colors of S/R lines and zones by consolidating the options under settings (rather than under style).
  Added extensions to active SR Zones to extend all the way right. 
  Added option to extend or not extend the previous S/R zones up to next S/R zone.
  Added optional time frame labels to active S/R zones, with left and right options as well as option to adjust how far to the right label is set.
  Fixed issue where the higher time frame S/R zone was not properly starting from the high/low of fractal. Now any higher time frame S/R will begin exactly at the High/Low points. Note that this may not work perfectly on stocks and if a fractal high/low is too many bars in the past, it will revert to a default max bars back to avoid script errors.
  Added to script a function that will prevent S/R zones from lower time frames displaying while on a higher time frame. This helps clean up the chart quite a bit.
  Created arrays for each time frame's boxes and lines so that the number of S/R zones can be controlled for each time frame and limit memory consumption.
  New alert options added and customized alert messages.
 
- The way this indicator works is it looks for fractal highs or fractal lows with volume that pierces above the volume's Moving Average. This moving average value can be modified in the settings for each time frame.
- The fractal highs will be confirmed with 3 successive higher highs followed by 2 successive lower highs and vice versa for the fractal lows.
- The zone is created from the fractal high/low and the close of the candle for whatever time frame you selected. The bigger the zone, the more significant that zone is.
- You can disable any zone, change the zones to show lines only, and modify all the colors, transparencies, and thickness of lines for all the zones.
- To create alerts, you first want to enable the types of alerts you want for each time frame in the indicator's settings. Then after you apply changes, right click on one of the zones on the chart, and click "Add Alert on Vol S/R Zones". You do not need to add a title as the correct alert messages are already built-in.
- More changes will be coming in the future!
I hope you find this indicator useful, if so please give it a thumbs up!
If you have any suggestions or features you would like to see, just let me know in the comment section. Thanks and enjoy!
lib_Indicators_v2_DTULibrary   "lib_Indicators_v2_DTU" 
This library functions returns included Moving averages, indicators with factorization, functions candles, function heikinashi and more. 
Created it to feed as backend of my indicator/strategy "Indicators & Combinations Framework Advanced v2  " that will be released ASAP.
This is replacement of  my previous indicator (lib_indicators_DT)
I will add an indicator example which will use this indicator named as "lib_indicators_v2_DTU example" to help the usage of this library
Additionally library will be updated with more indicators in the future
 NOTES: 
Indicator functions returns only one series :-(
plotcandle function returns candle   series
 INDICATOR LIST:    
hide   = 'DONT DISPLAY',                            //Dont display & calculate the indicator. (For my framework usage)
alma   = 'alma(src,len,offset=0.85,sigma=6)',       //Arnaud Legoux Moving Average 
ama    = 'ama(src,len,fast=14,slow=100)',           //Adjusted Moving Average
acdst  = 'accdist()',                               //Accumulation/distribution index. 
cma    = 'cma(src,len)',                            //Corrective Moving average    
dema   = 'dema(src,len)',                           //Double EMA  (Same as EMA with 2 factor)
ema    = 'ema(src,len)',                            //Exponential Moving Average 
gmma   = 'gmma(src,len)',                           //Geometric Mean Moving Average
hghst  = 'highest(src,len)',                        //Highest value for a given number of bars back.   
hl2ma  = 'hl2ma(src,len)',                          //higest lowest moving average
hma    = 'hma(src,len)',                            //Hull Moving Average.
lgAdt  = 'lagAdapt(src,len,perclen=5,fperc=50)',    //Ehler's Adaptive Laguerre filter
lgAdV  = 'lagAdaptV(src,len,perclen=5,fperc=50)',   //Ehler's Adaptive Laguerre filter variation
lguer  = 'laguerre(src,len)',                       //Ehler's Laguerre filter
lsrcp  = 'lesrcp(src,len)',                         //lowest exponential esrcpanding moving line
lexp   = 'lexp(src,len)',                           //lowest exponential expanding moving line 
linrg  = 'linreg(src,len,loffset=1)',               //Linear regression
lowst  = 'lowest(src,len)',                         //Lovest value for a given number of bars back.
pcnl   = 'percntl(src,len)',                        //percentile nearest rank. Calculates percentile using method of Nearest Rank.
pcnli  = 'percntli(src,len)',                       //percentile linear interpolation. Calculates percentile using method of linear interpolation between the two nearest ranks.
rema   = 'rema(src,len)',                           //Range EMA (REMA)   
rma    = 'rma(src,len)',                            //Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.
sma    = 'sma(src,len)',                            //Smoothed Moving Average
smma   = 'smma(src,len)',                           //Smoothed Moving Average
supr2  = 'super2(src,len)',                         //Ehler's super smoother, 2 pole 
supr3  = 'super3(src,len)',                         //Ehler's super smoother, 3 pole
strnd  = 'supertrend(src,len,period=3)',            //Supertrend indicator
swma   = 'swma(src,len)',                           //Sine-Weighted Moving Average
tema   = 'tema(src,len)',                           //Triple EMA  (Same as EMA with 3 factor)
tma    = 'tma(src,len)',                            //Triangular Moving Average
vida   = 'vida(src,len)',                           //Variable Index Dynamic Average   
vwma   = 'vwma(src,len)',                           //Volume Weigted Moving Average
wma    = 'wma(src,len)',                            //Weigted Moving Average 
angle  = 'angle(src,len)',                          //angle of the series   (Use its Input as another indicator output)
atr    = 'atr(src,len)',                            //average true range. RMA of true range.                
bbr    = 'bbr(src,len,mult=1)',                     //bollinger %%
bbw    = 'bbw(src,len,mult=2)',                     //Bollinger Bands Width. The Bollinger Band Width is the difference between the upper and the lower Bollinger Bands divided by the middle band.
cci    = 'cci(src,len)',                            //commodity channel index
cctbb  = 'cctbbo(src,len)',                         //CCT Bollinger Band Oscilator
chng   = 'change(src,len)',                         //Difference between current value and previous, source - source .
cmo    = 'cmo(src,len)',                            //Chande Momentum Oscillator. Calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movement over the same period.
cog    = 'cog(src,len)',                            //The cog (center of gravity) is an indicator based on statistics and the Fibonacci golden ratio.
cpcrv  = 'copcurve(src,len)',                       //Coppock Curve.  was originally developed by Edwin "Sedge" Coppock (Barron's Magazine, October 1962).
corrl  = 'correl(src,len)',                         //Correlation coefficient. Describes the degree to which two series tend to deviate from their ta.sma values.
count  = 'count(src,len)',                          //green avg - red avg
dev    = 'dev(src,len)',                            //ta.dev()  Measure of difference between the series and it's ta.sma
fall   = 'falling(src,len)',                        //ta.falling() Test if the `source` series is now falling for `length` bars long. (Use its Input as another indicator output)
kcr    = 'kcr(src,len,mult=2)',                     //Keltner Channels Range  
kcw    = 'kcw(src,len,mult=2)',                     //ta.kcw(). Keltner Channels Width. The Keltner Channels Width is the difference between the upper and the lower Keltner Channels divided by the middle channel.
macd   = 'macd(src,len)',                           //macd
mfi    = 'mfi(src,len)',                            //Money Flow Index
nvi    = 'nvi()',                                   //Negative Volume Index
obv    = 'obv()',                                   //On Balance Volume
pvi    = 'pvi()',                                   //Positive Volume Index 
pvt    = 'pvt()',                                   //Price Volume Trend
rise   = 'rising(src,len)',                         //ta.rising() Test if the `source` series is now rising for `length` bars long. (Use its Input as another indicator output)
roc    = 'roc(src,len)',                            //Rate of Change
rsi    = 'rsi(src,len)',                            //Relative strength Index
smosc  = 'smi_osc(src,len,fast=5, slow=34)',        //smi Oscillator
smsig  = 'smi_sig(src,len,fast=5, slow=34)',        //smi Signal
stdev  = 'stdev(src,len)',                          //Standart deviation
trix   = 'trix(src,len)' ,                           //the rate of change of a triple exponentially smoothed moving average.
tsi    = 'tsi(src,len)',                            //True Strength Index
vari   = 'variance(src,len)',                       //ta.variance(). Variance is the expectation of the squared deviation of a series from its mean (ta.sma), and it informally measures how far a set of numbers are spread out from their mean.
wilpc  = 'willprc(src,len)',                        //Williams %R
wad    = 'wad()',                                   //Williams Accumulation/Distribution.
wvad   = 'wvad()'                                   //Williams Variable Accumulation/Distribution.
}
 f_func(string, float, simple, float, float, float, simple)  f_func          Return selected indicator value with different parameters. New version. Use extra parameters for available indicators
  Parameters:
     string : FuncType_       indicator from the indicator list 
     float : src_            close, open, high, low,hl2, hlc3, ohlc4 or any  
     simple : int    length_         indicator length
     float : p1              extra parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p2              extra parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p3              extra parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     simple : int    version_        indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
  Returns: float                Return calculated indicator value
 fn_heikin(float, float, float, float)  fn_heikin  Return given  src data (open, high,low,close) as heikin ashi candle values
  Parameters:
     float : o_              open value
     float : h_              high value
     float : l_              low value
     float : c_              close value
  Returns: float          heikin ashi open, high,low,close vlues that will be used with plotcandle
 fn_plotFunction(float, string, simple, bool)  fn_plotFunction Return input src data with different plotting options
  Parameters:
     float : src_            indicator src_data or any other series.....
     string : plotingType     Ploting type of the function on the screen  
     simple : int    stochlen_       length for plotingType for stochastic and PercentRank options
     bool : plotSWMA        Use SWMA for smoothing Ploting
  Returns: float        
 fn_funcPlotV2(string, float, simple, float, float, float, simple, string, simple, bool, bool)  fn_funcPlotV2   Return selected indicator value with different parameters. New version. Use extra parameters fora available indicators
  Parameters:
     string : FuncType_       indicator from the indicator list
     float : src_data_       close, open, high, low,hl2, hlc3, ohlc4 or any  
     simple : int    length_         indicator length
     float : p1              extra parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p2              extra parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p3              extra parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     simple : int    version_        indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
     string : plotingType     Ploting type of the function on the screen  
     simple : int    stochlen_       length for plotingType for stochastic and PercentRank options
     bool : plotSWMA        Use SWMA for smoothing Ploting
     bool : log_            Use log on function entries
  Returns: float                Return calculated indicator value
 fn_factor(string, float, simple, float, float, float, simple, simple, string, simple, bool, bool)  fn_factor       Return selected indicator's  factorization with given arguments
  Parameters:
     string : FuncType_       indicator from the indicator list
     float : src_data_       close, open, high, low,hl2, hlc3, ohlc4 or any  
     simple : int    length_         indicator length
     float : p1              parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p2              parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p3              parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     simple : int    version_        indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
     simple : int    fact_           Add double triple, Quatr factor to selected  indicator (like converting EMA to 2-DEMA, 3-TEMA, 4-QEMA...)
     string : plotingType     Ploting type of the function on the screen  
     simple : int    stochlen_       length for plotingType for stochastic and PercentRank options
     bool : plotSWMA        Use SWMA for smoothing Ploting
     bool : log_            Use log on function entries
  Returns: float                Return result of the function
 fn_plotCandles(string, simple, float, float, float, simple, string, simple, bool, bool, bool)  fn_plotCandles  Return selected indicator's candle values with different parameters also heikinashi is available
  Parameters:
     string : FuncType_       indicator from the indicator list
     simple : int    length_         indicator length
     float : p1              parameter-1. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p2              parameter-2. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     float : p3              parameter-3. active on Version 2 for defining multi arguments indicator input value. ex: lagAdapt(src_, length_,LAPercLen_=p1,FPerc_=p2) 
     simple : int    version_        indicator version for backward compatibility. V1:dont use extra parameters p1,p2,p3 and use default values. V2: use extra parameters for available indicators
     string : plotingType     Ploting type of the function on the screen  
     simple : int    stochlen_       length for plotingType for stochastic and PercentRank options
     bool : plotSWMA        Use SWMA for smoothing Ploting
     bool : log_            Use log on function entries
     bool : plotheikin_     Use Heikin Ashi on Plot
  Returns: float       
[MF] Auto Fibonacci LevelsDescription:
Automatically draw Fibonacci Pivot levels based on the previous (day's, week's or month's)
Range ( High-Low ). The HLC3 is used as the default Pivot level.
Unlike the "Auto Fibonacci Levels", this variation does not update
Levels on current day even if the price goes past the R3/S3 levels.
Timeframes: 1D, 1W, 1M
Range = (High - Low) - From previous Day, Week or month.
FIB LEVELS:
- Yellow = Pivot and Pivot Zone (HLC3 by default)
- red = R1,S1 Levels 0.236 * Range
- Green = R2,S2 Levels 0.368 * Range
- Lime = R3,S3 Levels 0.618 * Range
- Blue = R4,S4 Levels 0.786 * Range
- Gray = R5,S5 Levels 1.000 * Range
- Lime = R6,S6 Levels 1.236 * Range
- Red = R7,S7 Levels 1.382 * Range
- Blue = R8,S8 Levels 1.618 * Range
- Green = R9,S9 Levels 2.000 * Range
CLASSIC LEVELS:
- Yellow = Pivot and Pivot Zone (HLC3)
- Green = R1,S1 Levels (Pivot*2 - Low), (Pivot*2 - High)
- Lime = R2,S2 Levels ( Pivot + Range), ( Pivot - Range)
- Lime = R3,S3 Levels (High + 2*( Pivot - Low)), (Low - 2*(High - Pivot ))
- Blue = R4,S4 Levels (High + 3*( Pivot - Low)), (Low - 3*(High - Pivot ))
Refrences:
- Auto Daily Fib Levels R3.0 by JustUncleL
- Auto Fib by TheYangGuizi
- Monthly Dynamic Range Levels (Fibonaci) V0 by RicardoSantos
Modifications:
- Added next FIB Levels. (changes during the current cycle)
- Added FIB 0.236 Levels
- Added Option to change the colors of the Fib Levels
- Changed Default colors to the colors of Tradingview
- Upgraded to Version4 Pinescript
supertrendHere is an extensive library on different variations of supertrend. 
Library   "supertrend" 
supertrend : Library dedicated to different variations of supertrend
 supertrend_atr(length, multiplier, atrMaType, source, highSource, lowSource, waitForClose, delayed)  supertrend_atr: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
	Parameters:
 	 length : : ATR Length
	 multiplier : : ATR Multiplier
	 atrMaType : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
	 source : : Default is close. Can Chose custom source
	 highSource : : Default is high. Can also use close price for both high and low source
	 lowSource : : Default is low. Can also use close price for both high and low source
	 waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
	 delayed : : if set to true lags supertrend atr stop based on target levels. 
	Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 supertrend_bands(bandType, maType, length, multiplier, source, highSource, lowSource, waitForClose, useTrueRange, useAlternateSource, alternateSource, sticky)  supertrend_bands: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
	Parameters:
 	 bandType : : Type of band used - can be bb, kc or dc
	 maType : : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
	 length : : Band Length
	 multiplier : : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
	 source : : Default is close. Can Chose custom source
	 highSource : : Default is high. Can also use close price for both high and low source
	 lowSource : : Default is low. Can also use close price for both high and low source
	 waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
	 useTrueRange : : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
	 useAlternateSource : - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
	 alternateSource : - Custom source for Donchian channel
	 sticky : : if set to true borders change only when price is beyond borders. 
	Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
 supertrend_zigzag(length, history, useAlternateSource, alternateSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType)  supertrend_zigzag: Zigzag pivot based supertrend
	Parameters:
 	 length : : Zigzag Length
	 history : : number of historical pivots to consider
	 useAlternateSource : - Custom source is used for Zigzag only if useAlternateSource is set to true
	 alternateSource : - Custom source for Zigzag
	 source : : Default is close. Can Chose custom source
	 highSource : : Default is high. Can also use close price for both high and low source
	 lowSource : : Default is low. Can also use close price for both high and low source
	 waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
	 atrlength : : ATR Length
	 multiplier : : ATR Multiplier
	 atrMaType : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma 
	Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
taLibrary   "ta" 
█  OVERVIEW 
This library holds technical analysis functions calculating values for which no Pine built-in exists.
 Look first. Then leap.  
█  FUNCTIONS 
 cagr(entryTime, entryPrice, exitTime, exitPrice) 
It calculates the "Compound Annual Growth Rate" between two points in time. The CAGR is a notional, annualized growth rate that assumes all profits are reinvested. It only takes into account the prices of the two end points — not drawdowns, so it does not calculate risk. It can be used as a yardstick to compare the performance of two instruments. Because it annualizes values, the function requires a minimum of one day between the two end points (annualizing returns over smaller periods of times doesn't produce very meaningful figures).
  Parameters:
     entryTime : The starting timestamp.
     entryPrice : The starting point's price.
     exitTime : The ending timestamp.
     exitPrice : The ending point's price.
  Returns: CAGR in % (50 is 50%). Returns `na` if there is not >=1D between `entryTime` and `exitTime`, or until the two time points have not been reached by the script.
█  v2, Mar. 8, 2022 
Added functions `allTimeHigh()` and `allTimeLow()` to find the highest or lowest value of a source from the first historical bar to the current bar. These functions will not look ahead; they will only return new highs/lows on the bar where they occur.
 allTimeHigh(src) 
Tracks the highest value of `src` from the first historical bar to the current bar.
  Parameters:
     src : (series int/float) Series to track. Optional. The default is `high`.
  Returns: (float) The highest value tracked.
 allTimeLow(src) 
Tracks the lowest value of `src` from the first historical bar to the current bar.
  Parameters:
     src : (series int/float) Series to track. Optional. The default is `low`.
  Returns: (float) The lowest value tracked.
█  v3, Sept. 27, 2022 
This version includes the following new functions: 
 aroon(length) 
  Calculates the values of the Aroon indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: ( [float, float ]) A tuple of the Aroon-Up and Aroon-Down values.
 coppock(source, longLength, shortLength, smoothLength) 
  Calculates the value of the Coppock Curve indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     longLength (simple int) : (simple int) Number of bars for the fast ROC value (length).
     shortLength (simple int) : (simple int) Number of bars for the slow ROC value (length).
     smoothLength (simple int) : (simple int) Number of bars for the weigted moving average value (length).
  Returns: (float) The oscillator value.
 dema(source, length) 
  Calculates the value of the Double Exponential Moving Average (DEMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The double exponentially weighted moving average of the `source`.
 dema2(src, length) 
  An alternate Double Exponential Moving Average (Dema) function to `dema()`, which allows a "series float" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The double exponentially weighted moving average of the `src`.
 dm(length) 
  Calculates the value of the "Demarker" indicator. 
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 donchian(length) 
  Calculates the values of a Donchian Channel using `high` and `low` over a given `length`.
  Parameters:
     length (int) : (series int) Number of bars (length).
  Returns: ( [float, float, float ]) A tuple containing the channel high, low, and median, respectively.
 ema2(src, length) 
  An alternate ema function to the `ta.ema()` built-in, which allows a "series float" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int/float) Number of bars (length).
  Returns: (float) The exponentially weighted moving average of the `src`.
 eom(length, div) 
  Calculates the value of the Ease of Movement indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
     div (simple int) : (simple int) Divisor used for normalzing values. Optional. The default is 10000.
  Returns: (float) The oscillator value.
 frama(source, length) 
  The Fractal Adaptive Moving Average (FRAMA), developed by John Ehlers, is an adaptive moving average that dynamically adjusts its lookback period based on fractal geometry.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The fractal adaptive moving average of the `source`.
 ft(source, length) 
  Calculates the value of the Fisher Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 ht(source) 
  Calculates the value of the Hilbert Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
  Returns: (float) The oscillator value.
 ichimoku(conLength, baseLength, senkouLength) 
  Calculates values of the Ichimoku Cloud indicator, including tenkan, kijun, senkouSpan1, senkouSpan2, and chikou. NOTE: offsets forward or backward can be done using the `offset` argument in `plot()`.
  Parameters:
     conLength (int) : (series int) Length for the Conversion Line (Tenkan). The default is 9 periods, which returns the mid-point of the 9 period Donchian Channel.
     baseLength (int) : (series int) Length for the Base Line (Kijun-sen). The default is 26 periods, which returns the mid-point of the 26 period Donchian Channel.
     senkouLength (int) : (series int) Length for the Senkou Span 2 (Leading Span B). The default is 52 periods, which returns the mid-point of the 52 period Donchian Channel.
  Returns: ( [float, float, float, float, float ]) A tuple of the Tenkan, Kijun, Senkou Span 1, Senkou Span 2, and Chikou Span values. NOTE: by default, the senkouSpan1 and senkouSpan2 should be plotted 26 periods in the future, and the Chikou Span plotted 26 days in the past.
 ift(source) 
  Calculates the value of the Inverse Fisher Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
  Returns: (float) The oscillator value.
 kvo(fastLen, slowLen, trigLen) 
  Calculates the values of the Klinger Volume Oscillator.
  Parameters:
     fastLen (simple int) : (simple int) Length for the fast moving average smoothing parameter calculation.
     slowLen (simple int) : (simple int) Length for the slow moving average smoothing parameter calculation.
     trigLen (simple int) : (simple int) Length for the trigger moving average smoothing parameter calculation.
  Returns: ( [float, float ]) A tuple of the KVO value, and the trigger value.
 pzo(length) 
  Calculates the value of the Price Zone Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 rms(source, length) 
  Calculates the Root Mean Square of the `source` over the `length`.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The RMS value.
 rwi(length) 
  Calculates the values of the Random Walk Index.
  Parameters:
     length (simple int) : (simple int) Lookback and ATR smoothing parameter length.
  Returns: ( [float, float ]) A tuple of the `rwiHigh` and `rwiLow` values.
 stc(source, fast, slow, cycle, d1, d2) 
  Calculates the value of the Schaff Trend Cycle indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     fast (simple int) : (simple int) Length for the MACD fast smoothing parameter calculation.
     slow (simple int) : (simple int) Length for the MACD slow smoothing parameter calculation.
     cycle (simple int) : (simple int) Number of bars for the Stochastic values (length).
     d1 (simple int) : (simple int) Length for the initial %D smoothing parameter calculation.
     d2 (simple int) : (simple int) Length for the final %D smoothing parameter calculation.
  Returns: (float) The oscillator value.
 stochFull(periodK, smoothK, periodD) 
  Calculates the %K and %D values of the Full Stochastic indicator.
  Parameters:
     periodK (simple int) : (simple int) Number of bars for Stochastic calculation. (length).
     smoothK (simple int) : (simple int) Number of bars for smoothing of the %K value (length).
     periodD (simple int) : (simple int) Number of bars for smoothing of the %D value (length).
  Returns: ( [float, float ]) A tuple of the slow %K and the %D moving average values.
 stochRsi(lengthRsi, periodK, smoothK, periodD, source) 
  Calculates the %K and %D values of the Stochastic RSI indicator.
  Parameters:
     lengthRsi (simple int) : (simple int) Length for the RSI smoothing parameter calculation.
     periodK (simple int) : (simple int) Number of bars for Stochastic calculation. (length).
     smoothK (simple int) : (simple int) Number of bars for smoothing of the %K value (length).
     periodD (simple int) : (simple int) Number of bars for smoothing of the %D value (length).
     source (float) : (series int/float) Series of values to process. Optional. The default is `close`.
  Returns: ( [float, float ]) A tuple of the slow %K and the %D moving average values.
 supertrend(factor, atrLength, wicks) 
  Calculates the values of the SuperTrend indicator with the ability to take candle wicks into account, rather than only the closing price.
  Parameters:
     factor (float) : (series int/float) Multiplier for the ATR value.
     atrLength (simple int) : (simple int) Length for the ATR smoothing parameter calculation.
     wicks (simple bool) : (simple bool) Condition to determine whether to take candle wicks into account when reversing trend, or to use the close price. Optional. Default is false.
  Returns: ( [float, int ]) A tuple of the superTrend value and trend direction.
 szo(source, length) 
  Calculates the value of the Sentiment Zone Oscillator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 t3(source, length, vf) 
  Calculates the value of the Tilson Moving Average (T3).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
     vf (simple float) : (simple float) Volume factor. Affects the responsiveness.
  Returns: (float) The Tilson moving average of the `source`.
 t3Alt(source, length, vf) 
  An alternate Tilson Moving Average (T3) function to `t3()`, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
     vf (simple float) : (simple float) Volume factor. Affects the responsiveness.
  Returns: (float) The Tilson moving average of the `source`.
 tema(source, length) 
  Calculates the value of the Triple Exponential Moving Average (TEMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The triple exponentially weighted moving average of the `source`.
 tema2(source, length) 
  An alternate Triple Exponential Moving Average (TEMA) function to `tema()`, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The triple exponentially weighted moving average of the `source`.
 trima(source, length) 
  Calculates the value of the Triangular Moving Average (TRIMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The triangular moving average of the `source`.
 trima2(src, length) 
  An alternate Triangular Moving Average (TRIMA) function to `trima()`, which allows a "series int" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int) Number of bars (length).
  Returns: (float) The triangular moving average of the `src`.
 trix(source, length, signalLength, exponential) 
  Calculates the values of the TRIX indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
     signalLength (simple int) : (simple int) Length for smoothing the signal line.
     exponential (simple bool) : (simple bool) Condition to determine whether exponential or simple smoothing is used. Optional. The default is `true` (exponential smoothing).
  Returns: ( [float, float, float ]) A tuple of the TRIX value, the signal value, and the histogram.
 uo(fastLen, midLen, slowLen) 
  Calculates the value of the Ultimate Oscillator.
  Parameters:
     fastLen (simple int) : (series int) Number of bars for the fast smoothing average (length).
     midLen (simple int) : (series int) Number of bars for the middle smoothing average (length).
     slowLen (simple int) : (series int) Number of bars for the slow smoothing average (length).
  Returns: (float) The oscillator value.
 vhf(source, length) 
  Calculates the value of the Vertical Horizontal Filter.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 vi(length) 
  Calculates the values of the Vortex Indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: ( [float, float ]) A tuple of the viPlus and viMinus values.
 vzo(length) 
  Calculates the value of the Volume Zone Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 williamsFractal(period) 
  Detects Williams Fractals.
  Parameters:
     period (int) : (series int) Number of bars (length).
  Returns: ( [bool, bool ]) A tuple of an up fractal and down fractal. Variables are true when detected.
 wpo(length) 
  Calculates the value of the Wave Period Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
█  v7, Nov. 2, 2023 
This version includes the following new and updated functions: 
 atr2(length) 
  An alternate ATR function to the `ta.atr()` built-in, which allows a "series float" `length` argument.
  Parameters:
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The ATR value.
 changePercent(newValue, oldValue) 
  Calculates the percentage difference between two distinct values.
  Parameters:
     newValue (float) : (series int/float) The current value.
     oldValue (float) : (series int/float) The previous value.
  Returns: (float) The percentage change from the `oldValue` to the `newValue`.
 donchian(length) 
  Calculates the values of a Donchian Channel using `high` and `low` over a given `length`.
  Parameters:
     length (int) : (series int) Number of bars (length).
  Returns: ( [float, float, float ]) A tuple containing the channel high, low, and median, respectively.
 highestSince(cond, source) 
  Tracks the highest value of a series since the last occurrence of a condition.
  Parameters:
     cond (bool) : (series bool) A condition which, when `true`, resets the tracking of the highest `source`.
     source (float) : (series int/float) Series of values to process. Optional. The default is `high`.
  Returns: (float) The highest `source` value since the last time the `cond` was `true`.
 lowestSince(cond, source) 
  Tracks the lowest value of a series since the last occurrence of a condition.
  Parameters:
     cond (bool) : (series bool) A condition which, when `true`, resets the tracking of the lowest `source`.
     source (float) : (series int/float) Series of values to process. Optional. The default is `low`.
  Returns: (float) The lowest `source` value since the last time the `cond` was `true`.
 relativeVolume(length, anchorTimeframe, isCumulative, adjustRealtime) 
  Calculates the volume since the last change in the time value from the `anchorTimeframe`, the historical average volume using bars from past periods that have the same relative time offset as the current bar from the start of its period, and the ratio of these volumes. The volume values are cumulative by default, but can be adjusted to non-accumulated with the `isCumulative` parameter.
  Parameters:
     length (simple int) : (simple int) The number of periods to use for the historical average calculation.
     anchorTimeframe (simple string) : (simple string) The anchor timeframe used in the calculation. Optional. Default is "D".
     isCumulative (simple bool) : (simple bool) If `true`, the volume values will be accumulated since the start of the last `anchorTimeframe`. If `false`, values will be used without accumulation. Optional. The default is `true`.
     adjustRealtime (simple bool) : (simple bool) If `true`, estimates the cumulative value on unclosed bars based on the data since the last `anchor` condition. Optional. The default is `false`.
  Returns: ( [float, float, float ]) A tuple of three float values. The first element is the current volume. The second is the average of volumes at equivalent time offsets from past anchors over the specified number of periods. The third is the ratio of the current volume to the historical average volume.
 rma2(source, length) 
  An alternate RMA function to the `ta.rma()` built-in, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The rolling moving average of the `source`.
 supertrend2(factor, atrLength, wicks) 
  An alternate SuperTrend function to `supertrend()`, which allows a "series float" `atrLength` argument.
  Parameters:
     factor (float) : (series int/float) Multiplier for the ATR value.
     atrLength (float) : (series int/float) Length for the ATR smoothing parameter calculation.
     wicks (simple bool) : (simple bool) Condition to determine whether to take candle wicks into account when reversing trend, or to use the close price. Optional. Default is `false`.
  Returns: ( [float, int ]) A tuple of the superTrend value and trend direction.
 vStop(source, atrLength, atrFactor) 
  Calculates an ATR-based stop value that trails behind the `source`. Can serve as a possible stop-loss guide and trend identifier.
  Parameters:
     source (float) : (series int/float) Series of values that the stop trails behind.
     atrLength (simple int) : (simple int) Length for the ATR smoothing parameter calculation.
     atrFactor (float) : (series int/float) The multiplier of the ATR value. Affects the maximum distance between the stop and the `source` value. A value of 1 means the maximum distance is 100% of the ATR value. Optional. The default is 1.
  Returns: ( [float, bool ]) A tuple of the volatility stop value and the trend direction as a "bool".
 vStop2(source, atrLength, atrFactor) 
  An alternate Volatility Stop function to `vStop()`, which allows a "series float" `atrLength` argument.
  Parameters:
     source (float) : (series int/float) Series of values that the stop trails behind.
     atrLength (float) : (series int/float) Length for the ATR smoothing parameter calculation.
     atrFactor (float) : (series int/float) The multiplier of the ATR value. Affects the maximum distance between the stop and the `source` value. A value of 1 means the maximum distance is 100% of the ATR value. Optional. The default is 1.
  Returns: ( [float, bool ]) A tuple of the volatility stop value and the trend direction as a "bool".
Removed Functions: 
 allTimeHigh(src) 
  Tracks the highest value of `src` from the first historical bar to the current bar.
 allTimeLow(src) 
  Tracks the lowest value of `src` from the first historical bar to the current bar.
 trima2(src, length) 
  An alternate Triangular Moving Average (TRIMA) function to `trima()`, which allows a
"series int" length argument.
My:HTF O/H/L/C█ MY Higher Time Frame Open / High / Low / Close
This indicator shows one line per Higher Time Frame Price of Interest.
We are interested to know whether we are currently seeing support or resistance at previous daily / weekly / monthly price of interest.
Each price of interest can be displayed or hidden in the configuration. Each line has a label attached to it with the (short) label on it to help identifying what is this line.
Price of interest with (short) label : 
 
  Current Daily Open (CDO)
  Current Daily High (CDH)
  Current Daily Low (CDL)
  Previous Daily Open (PDO)
  Previous Daily High (PDH)
  Previous Daily Low (PDL)
  Previous Daily Close (PDC)
  Current Weekly Open (CWO)
  Current Weekly High (CWH)
  Current Weekly Low (CWL)
  Previous Weekly Open (PWO)
  Previous Weekly High (PWH)
  Previous Weekly Low (PWL)
  Previous Weekly Close (PWC)
  Current Monthly Open (CMO)
  Current Monthly High (CMH)
  Current Monthly Low (CML)
  Previous Monthly Open (PMO)
  Previous Monthly High (PMH)
  Previous Monthly Low (PML)
  Previous Monthly Close (PMC)






















